package cc.rengu.igas.bomp.common.enums;

/**
 * Created by zhangxuran on 2020/04/21
 */
public enum FundTypeEnum {
    SETTLE_TYPE("00", "商户结算净额"),
    SERVICE_FEE_TYPE("01", "商户手续费"),
    RESERVE_FUND_TYPE("02", "商户备用金"),
    D0_REFUND_TYPE("03", "商户D0退款户"),
    ;
    private String fundCode;
    private String fundDesc;

    FundTypeEnum(String fundCode, String fundDesc) {
        this.fundCode = fundCode;
        this.fundDesc = fundDesc;
    }

    public String getFundCode() {
        return fundCode;
    }

    public void setFundCode(String fundCode) {
        this.fundCode = fundCode;
    }

    public String getFundDesc() {
        return fundDesc;
    }

    public void setFundDesc(String fundDesc) {
        this.fundDesc = fundDesc;
    }

    /*
     * 根据编码查询资金类型信息
     * fundCode 资金类型编码
     * */
    public static String getFundDescByfundCode(String fundCode) {
        for (FundTypeEnum fundTypeEnum : FundTypeEnum.values()) {
            if (fundTypeEnum.getFundCode().equals(fundCode)) {
                return fundTypeEnum.getFundDesc();
            }
        }
        return null;
    }
}
